package com.allwees.bs.c.module.payment.req;

import com.allwees.bs.core.modelbase.req.Req;
import com.allwees.bs.core.modelbase.validate.ValidateItem;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

@Data
@EqualsAndHashCode(callSuper = true)
public class PaymentCreditCardReq extends Req {

    private String number;

    private String type;

    private String cvv2;

    private String expireYear;

    private String expireMonth;

    @Override
    public ValidateItem[] getValidateItems() {
        return new ValidateItem[]{
                new ValidateItem(StringUtils.isBlank(number), "card number can not be empty"),
                new ValidateItem(StringUtils.isBlank(type), "card type can not be empty"),
                new ValidateItem(StringUtils.isBlank(cvv2), "card cvv2 can not be empty"),
                new ValidateItem(StringUtils.isBlank(expireYear), "card expireYear can not be empty"),
                new ValidateItem(StringUtils.isBlank(expireMonth), "card expireMonth can not be empty"),
        };
    }
}
